0

ios 10にはUNUserNotificationCenterクラスとメソッドgetNotificationSettingsWithCompletionHandlerがあり、これはUNNotificationSettingsオブジェクトを提供し、ユーザーはプッシュ通知のアクセス許可を求めることができます。これがiOS 9とiOS 8 。プッシュ通知が確定していない

答えて

0

。その機能はios 10以降から利用できます。

1

あなたはこのようなものを使用することができます方法はありません

let notificationType = UIApplication.sharedApplication().currentUserNotificationSettings()!.types 

if notificationType == UIUserNotificationType.None { 
    // Push notifications are disabled in setting by user. 
} else { 
// Push notifications are enabled in setting by user. 
} 

if notificationType != UIUserNotificationType.None { 
    // Push notifications are enabled in setting by user. 
} 

if notificationType == UIUserNotificationType.Badge { 
    // the application may badge its icon upon a notification being received 
} 

if notificationType == UIUserNotificationType.Sound { 
    // the application may play a sound upon a notification being received 
} 

if notificationType == UIUserNotificationType.Alert { 
    // the application may display an alert upon a notification being received 
} 
関連する問題