我无法接收来自解析网站的推送通知,它说发送到2个设备但推送已发送为0,我可以在解析核心的安装类中看到我的设备带有id和all.
我甚至用过
-(void)application:(UIApplication *)application didFailToRegisterForRemoteNotificationsWithError:(NSError *)error{
...
}
Run Code Online (Sandbox Code Playgroud)
为了显示任何错误但没有找到任何内容.有关如何解决这种情况的任何建议?
我正在使用以下代码通过URLConfiguration设置URLSession的缓存策略。
if appDelegateObj.configuration == nil {
appDelegateObj.configuration = URLSessionConfiguration.default
}
if self.apiType == ServerRequest.API_TYPES_NAME.API1 {
if appDelegateObj.forceReload == true {
appDelegateObj.configuration?.urlCache = nil
appDelegateObj.configuration?.requestCachePolicy = .reloadIgnoringLocalCacheData
}else{
appDelegateObj.configuration?.requestCachePolicy = .returnCacheDataElseLoad
}
}else{
appDelegateObj.configuration?.requestCachePolicy = .reloadIgnoringLocalCacheData
}
session = URLSession(configuration: appDelegateObj.configuration!, delegate: nil, delegateQueue: nil)
Run Code Online (Sandbox Code Playgroud)
我遇到的问题是,即使设置了
appDelegateObj.configuration?.urlCache = nil
Run Code Online (Sandbox Code Playgroud)
我能够获取新数据的唯一方法是通过使用
appDelegateObj.configuration?.requestCachePolicy = .reloadIgnoringLocalCacheData
Run Code Online (Sandbox Code Playgroud)
我究竟做错了什么 ?我需要一种方法来清除该应用程序的所有缓存数据。
我尝试使用
URLCache.shared.removeAllCachedResponses()
Run Code Online (Sandbox Code Playgroud)
但这也不起作用。