我有一个ios应用程序,从服务器发送通知时我将远程通知发送到哪里,我正在设置内容-available = 1且声音=“” 在IOS设备上使用时
applicaiton(didReceiveRemoteNotification:fetchCompletionHandler :)
我看到应用程序在后台运行时到达此方法,但是在关闭应用程序时未调用此方法,但是在关闭应用程序时未调用该方法
applicaiton(didReceiveRemoteNotification:fetchCompletionHandler :)
我在此方法中的处理程序是
let userInfoDic = userInfo as NSDictionary as? [String: Any]
let cato = userInfoDic?["cato"] as? String
if cato == "message" {
let state: UIApplicationState = UIApplication.shared.applicationState
if state == .active{
print("Application is Active Socket IO will Handle This")
}else{
let apnMessage = userInfoDic?["apnMessage"] as? [String: Any]
if (apnMessage == nil){
print("Error Fetching Message")
}else{
let count = UserDefaults.standard.integer(forKey:"TotalUnredMessage")
DispatchQueue.main.async {
UIApplication.shared.applicationIconBadgeNumber = count + 1
}
UserDefaults.standard.set(count, forKey: …Run Code Online (Sandbox Code Playgroud) 我要求以多种语言显示一个文本,尤其是Kannada和Telugu我正在使用最低要求的API 14(4.0)进行开发
谢谢