How to set up push notifications in Swift

后端 未结 11 1189
生来不讨喜
生来不讨喜 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:55

    You can send notification using the following code snippet:

    let settings = UIUserNotificationSettings(forTypes: [.Alert, .Badge, .Sound], categories: nil)
    if(UIApplication.sharedApplication().currentUserNotificationSettings() == settings ){
    //OK
    }else{
    //KO
    }
    

提交回复
热议问题