JPush 3.1.1 App适配最低版本8.0,开发语言Swift 4.2, JPUSHRegisterDelegate无法识别

ios
标签: #<Tag:0x00007fb8335fe928>

(Crazy) #1

Type ‘AppDelegate’ cannot conform to protocol ‘JPUSHRegisterDelegate’ because it has requirements that cannot be satisfied


(12) #2

参考 swift demo


(Crazy) #3

已经解决了,ide重启就好了~~~~~

    let entity = JPUSHRegisterEntity.init()
    if #available(iOS 12.0, *) {
        entity.types = Int(JPAuthorizationOptions.alert.rawValue | JPAuthorizationOptions.badge.rawValue | JPAuthorizationOptions.sound.rawValue | JPAuthorizationOptions.providesAppNotificationSettings.rawValue)
    } else {
        entity.types = Int(JPAuthorizationOptions.alert.rawValue | JPAuthorizationOptions.badge.rawValue | JPAuthorizationOptions.sound.rawValue)
    }
    
    JPUSHService.register(forRemoteNotificationConfig: entity, delegate: self)
    JPUSHService.setup(withOption: launchOptions, appKey: kJPushApiKey, channel: "App Store", apsForProduction: false)