How to set up push notifications in Swift

后端 未结 11 1205
生来不讨喜
生来不讨喜 2020-11-27 10:48

I am trying to set up a push notification system for my application. I have a server and a developer license to set up the push notification service.

I am currently

11条回答
  •  一个人的身影
    2020-11-27 11:44

    To register to receive push notifications via Apple Push Service you have to call a registerForRemoteNotifications() method of UIApplication.

    If registration succeeds, the app calls your app delegate object’s application:didRegisterForRemoteNotificationsWithDeviceToken: method and passes it a device token.

    You should pass this token along to the server you use to generate push notifications for the device. If registration fails, the app calls its app delegate’s application:didFailToRegisterForRemoteNotificationsWithError: method instead.

    Have a look into Local and Push Notification Programming Guide.

提交回复
热议问题